package com.isnmp.nms.framework.discover.service;

import java.util.List;

import com.isnmp.common.snmp.SNMPTarget;
import com.isnmp.nms.framework.discover.DeviceInfo;
import com.isnmp.nms.framework.discover.DeviceTypeInfo;

class IpSearchTask implements Runnable {
    String ip;
    List<SNMPTarget> snmpTargetList;
    List<DeviceInfo> rsList;
    boolean isUsePing;

    public IpSearchTask(String paramString, List<SNMPTarget> paramList, List<DeviceInfo> paramList1, boolean paramBoolean) {
        this.snmpTargetList = paramList;
        this.ip = paramString;
        this.rsList = paramList1;
        this.isUsePing = paramBoolean;
    }

    public void run() {
        try {
            DeviceInfo localDeviceInfo = new SearchBasicDeviceInfoService().getDeviceBasicInfo(this.ip, this.snmpTargetList, this.isUsePing);
            if (localDeviceInfo != null) {
                DeviceTypeInfo localDeviceTypeInfo = new SearchTypeService().matchDeviceType(localDeviceInfo);
                localDeviceInfo.setDeviceType(localDeviceTypeInfo);
                synchronized (this.rsList) {
                    if (!this.rsList.contains(localDeviceInfo))
                        this.rsList.add(localDeviceInfo);
                }
            }
        } catch (Exception localException) {
            //localException.printStackTrace();
        }
    }
}